package com.hksj.common.core.model;

import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;

@Data
public class BasePageQuery implements Serializable {
    @ApiModelProperty(value = "起始页 非必传，默认第一页",example = "1",position = 199)
    private Integer pageNum = 1;

    @ApiModelProperty(value = "每页大小 非必传，默认15条",example = "15",position = 200)
    private Integer pageSize = 15;

    @JsonIgnore
    @ApiModelProperty(value = "分页起始行 不用传值")
    private Integer startRow;

    @ApiModelProperty(value = "不使用分页",example = "false")
    private Boolean disAblePage = false;

    public Integer getStartRow() {
        return (pageNum - 1) * pageSize;
    }
}
